:root {
    --primary-bg: #fafafa;
    --surface: #ffffff;
    --primary-text: #2c2c2c;
    --muted-text: #6b7280;
    --primary-accent: #1a1a1a;
    --secondary-accent: #d4af37;
    --border: #e5e7eb;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode {
    --primary-bg: #121212;
    --surface: #1a1a1a;
    --primary-text: #f1f1f1;
    --muted-text: #c7c7c7;
    --primary-accent: #f1f1f1;
    --secondary-accent: #d4af37;
    --border: #2a2a2a;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Global Rules */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "Poppins", sans-serif;
    color: var(--primary-text);
    background: var(--primary-bg);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

body.dark-mode .searchbar input {
    background: #1b1b1b;
    color: #f1f1f1;
    border-color: #2a2a2a;
}

body.dark-mode #searchClose {
    color: #fff;
}

body.dark-mode #searchClose:hover {
    color: var(--secondary-accent);
}

/* NAVBAR */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.nav_left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    height: 65px;
}

.nav_menu {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav_menu>li>a {
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 10px;
}

.nav_menu>li>a:hover {
    background: rgba(0, 0, 0, 0.06);
}

.nav_icons {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    position: relative;
    padding: 8px;
    border-radius: 10px;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--secondary-accent);
    color: #000;
    border-radius: 999px;
    font-size: 9px;
    padding: 2px 6px;
    border: 1px solid #00000022;
}

.nav_icons .icon-btn.cart-active {
    border: 2px solid var(--secondary-accent);
    border-radius: 10px;
}

.nav_toggle {
    display: none;
    background: transparent;
    border: 0;
    font-size: 22px;
}

@media (max-width: 991px) {
    .nav_toggle {
        display: block;
    }

    .nav_menu {
        position: absolute;
        left: 0;
        right: 0;
        top: 64px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        display: none;
        flex-direction: column;
        padding: 12px;
    }

    .nav_menu.open {
        display: flex;
    }
}

/* SEARCHBAR */
.searchbar {
    display: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.searchbar form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 0;
}

.searchbar input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: #111;
}

.searchbar .close {
    display: grid;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

/* Cart Table */
table {
    border-collapse: collapse;
    width: 85%;
    margin: 3% auto;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

th,
td {
    padding: 1.2rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted-text);
    font-weight: 600;
    font-size: 1em;
    background: var(--surface);
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.product-cell img {
    width: 80px;
    height: auto;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.total-cell {
    font-weight: 700;
    color: var(--primary-text);
    font-size: 1.05em;
}

/* Quantity controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

.up-down {
    display: flex;
    flex-direction: column;
    margin-left: 5px;
}

.quantity-controls input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 1em;
    background: var(--surface);
    color: var(--primary-text);
}

/* Grand total */
#grand-total {
    text-align: right;
    font-weight: 700;
    font-size: 1.1em;
    margin: 2% 15% 1%;
}

/* SUBMIT ORDER BUTTON */
nav.home-btn.submit-order-btn {
    background: transparent;
    border: none;
    margin: 2% 15% 3% 0;
    text-align: right;
}

.submit-order-btn ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.submit-order-btn li {
    display: inline-block;
    margin: 0;
}

.submit-order-btn a {
    display: inline-block;
    padding: 12px 28px;
    background: var(--secondary-accent);
    color: #000;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--secondary-accent);
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s ease;
}

.submit-order-btn a:hover {
    background: transparent;
    color: var(--secondary-accent);
}

/* Footer */
.footer {
    background: #2c2c2c;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
}

/* Dark Mode Adjustments */
body.dark-mode table {
    background: var(--surface);
}

body.dark-mode th {
    background: var(--surface);
    color: var(--muted-text);
}

body.dark-mode .submit-order-btn {
    background: transparent;
    color: #000;
}

body.dark-mode .submit-order-btn:hover {
    background: transparent;
    color: var(--secondary-accent);
}